Optimal. Leaf size=59 \[ \frac{\left (a^2+b^2\right ) \tan (c+d x)}{d}-\frac{a^2 \cot (c+d x)}{d}+\frac{2 a b \sec (c+d x)}{d}-\frac{2 a b \tanh ^{-1}(\cos (c+d x))}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.281159, antiderivative size = 59, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.207, Rules used = {2911, 2622, 321, 207, 3200, 14} \[ \frac{\left (a^2+b^2\right ) \tan (c+d x)}{d}-\frac{a^2 \cot (c+d x)}{d}+\frac{2 a b \sec (c+d x)}{d}-\frac{2 a b \tanh ^{-1}(\cos (c+d x))}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2911
Rule 2622
Rule 321
Rule 207
Rule 3200
Rule 14
Rubi steps
\begin{align*} \int \csc ^2(c+d x) \sec ^2(c+d x) (a+b \sin (c+d x))^2 \, dx &=(2 a b) \int \csc (c+d x) \sec ^2(c+d x) \, dx+\int \csc ^2(c+d x) \sec ^2(c+d x) \left (a^2+b^2 \sin ^2(c+d x)\right ) \, dx\\ &=\frac{\operatorname{Subst}\left (\int \frac{a^2+\left (a^2+b^2\right ) x^2}{x^2} \, dx,x,\tan (c+d x)\right )}{d}+\frac{(2 a b) \operatorname{Subst}\left (\int \frac{x^2}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{d}\\ &=\frac{2 a b \sec (c+d x)}{d}+\frac{\operatorname{Subst}\left (\int \left (a^2 \left (1+\frac{b^2}{a^2}\right )+\frac{a^2}{x^2}\right ) \, dx,x,\tan (c+d x)\right )}{d}+\frac{(2 a b) \operatorname{Subst}\left (\int \frac{1}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{d}\\ &=-\frac{2 a b \tanh ^{-1}(\cos (c+d x))}{d}-\frac{a^2 \cot (c+d x)}{d}+\frac{2 a b \sec (c+d x)}{d}+\frac{\left (a^2+b^2\right ) \tan (c+d x)}{d}\\ \end{align*}
Mathematica [A] time = 0.339447, size = 102, normalized size = 1.73 \[ -\frac{\csc \left (\frac{1}{2} (c+d x)\right ) \sec \left (\frac{1}{2} (c+d x)\right ) \sec (c+d x) \left (\left (2 a^2+b^2\right ) \cos (2 (c+d x))-b \left (4 a \sin (c+d x)-2 a \sin (2 (c+d x)) \left (\log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )\right )+b\right )\right )}{4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.071, size = 90, normalized size = 1.5 \begin{align*}{\frac{{a}^{2}}{d\sin \left ( dx+c \right ) \cos \left ( dx+c \right ) }}-2\,{\frac{{a}^{2}\cot \left ( dx+c \right ) }{d}}+2\,{\frac{ab}{d\cos \left ( dx+c \right ) }}+2\,{\frac{ab\ln \left ( \csc \left ( dx+c \right ) -\cot \left ( dx+c \right ) \right ) }{d}}+{\frac{{b}^{2}\tan \left ( dx+c \right ) }{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.00398, size = 96, normalized size = 1.63 \begin{align*} \frac{a b{\left (\frac{2}{\cos \left (d x + c\right )} - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - a^{2}{\left (\frac{1}{\tan \left (d x + c\right )} - \tan \left (d x + c\right )\right )} + b^{2} \tan \left (d x + c\right )}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.93319, size = 293, normalized size = 4.97 \begin{align*} -\frac{a b \cos \left (d x + c\right ) \log \left (\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) \sin \left (d x + c\right ) - a b \cos \left (d x + c\right ) \log \left (-\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) \sin \left (d x + c\right ) +{\left (2 \, a^{2} + b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2}}{d \cos \left (d x + c\right ) \sin \left (d x + c\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.17076, size = 173, normalized size = 2.93 \begin{align*} \frac{12 \, a b \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right ) + 3 \, a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - \frac{4 \, a b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 15 \, a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 12 \, b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 20 \, a b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 3 \, a^{2}}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} - \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}}{6 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]